<?php
/* @var $this UsuariosController */
/* @var $model usuarios */

?>
<?php //boton 
$this->widget('bootstrap.widgets.TbButton', array(
       'label'=>'Regresar',
       'type'=>'primary',
       'size'=>'medium',
       'url'=>array('usuarios/admin'),
      
   )); //fin boton  
 echo '</br>'.'</br>';
   ?>

<h1>Usuarios <?php echo $model->Us_nombrecompleto; ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'htmlOptions'=>array("class"=>"table table-striped"),//arregue esta linea modificación de tabla
	'attributes'=>array(
		'Us_idusuario_PK',
		'Us_nombrecompleto',
		'username',
		'password',
		'Us_telefono',
		'Us_direccion',
		'Us_cedula',
	),
)); ?>
<!--div class="ajuste">
<div class="form"-->
<br>
<h1>Permiso de usuarios</h1>
<!--?php $form=$this->beginWidget("CActiveForm"); ?-->
<!--div class="row"-->
<!--?php echo $form->labelEx($role,"Nombre"); ?-->
<!--?php echo $form->textField($role,"name"); ?-->
<!--?php echo $form->error($role,"name"); ?-->
<!--/div-->
<!--div class="row"-->
<!--?php echo $form->labelEx($role,"Description"); ?-->
<!--?php echo $form->textArea($role,"description") ?-->
<!--?php echo $form->error($role,"description"); ?-->
<!--/div>
<div class=" row buttons"-->
		<!--?php echo CHtml::submitButton("Crear",array("class"=>"btn btn-primary")); ?-->
<!--/div-->
<!--?php $this->endWidget(); ?-->

<div class="row">
<div class="span12">
<ul class="nav nav-pills nav-stacked">
<?php foreach (Yii::app()->authManager->getAuthItems() as $data):?>
<?php $enabled=Yii::app()->authManager->checkAccess($data->name,$model->Us_idusuario_PK)?>
<li> 
<div class="">
	<h4><?php echo $data->name?>
	<small>
	<?php if ($data->type==0) echo "Rol";?>
	<?php if ($data->type==1) echo "Tarea";?>
	<?php if ($data->type==2) echo "Operación";?>
	</small>
	<?php echo CHtml::link($enabled?"Quitar":"Aplicar",array("usuarios/assign","id"=>$model->Us_idusuario_PK,"item"=>$data->name),
	array("class"=>$enabled?"btn btn-danger":"btn btn-primary")); ?>
	</h4>
	</div>
	<p>
	<?php echo $data->description?>
	</p>
	<hr>

</li>
<?php endforeach;?>
</ul>
</div>
</div>

